import 'package:module_business/module_index/model/voice_person_entity.dart';

class IndexRoomItemEntity {
  int id;
  String roomName;
  String roomCode;
  String roomSynopsis;
  String yxRoomId;
  String password;
  int charismaShow;
  String backgroundImg;
  dynamic lockFlag;
  dynamic roomLabel;
  String homeownerNickname;
  String homeownerIcon;
  List<VoicePersonEntity> voiceMikeDetailVoList;
  String agoraToken;
  int homeownerId;
  int relationType;
  String coverImg;
  int roomState;
  int valid;
  dynamic charisma;

  IndexRoomItemEntity(
      {this.id,
        this.roomName,
        this.roomSynopsis,
        this.roomCode,
        this.yxRoomId,
        this.password,
        this.charismaShow,
        this.backgroundImg,
        this.lockFlag,
        this.roomLabel,
        this.homeownerNickname,
        this.homeownerIcon,
        this.voiceMikeDetailVoList,
        this.agoraToken,
        this.homeownerId,
        this.relationType,
        this.coverImg,
        this.roomState,
        this.valid,
        this.charisma});

  IndexRoomItemEntity.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    roomName = json['roomName'];
    roomSynopsis = json['roomSynopsis'];
    roomCode = json['roomCode'];
    yxRoomId = json['yxRoomId'];
    password = json['password'];
    charismaShow = json['charismaShow'];
    backgroundImg = json['backgroundImg'];
    lockFlag = json['lockFlag'];
    roomLabel = json['roomLabel'];
    homeownerNickname = json['homeownerNickname'];
    homeownerIcon = json['homeownerIcon'];
    if (json['voiceMikeDetailVoList'] != null) {
      voiceMikeDetailVoList = new List<VoicePersonEntity>();
      json['voiceMikeDetailVoList'].forEach((v) {
        voiceMikeDetailVoList.add(new VoicePersonEntity.fromJson(v));
      });
    }
    agoraToken = json['agoraToken'];
    homeownerId = json['homeownerId'];
    relationType = json['relationType'];
    coverImg = json['coverImg'];
    roomState = json['roomState'];
    valid = json['valid'];
    charisma = json['charisma'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['id'] = this.id;
    data['roomName'] = this.roomName;
    data['roomSynopsis'] = this.roomSynopsis;
    data['roomCode'] = this.roomCode;
    data['yxRoomId'] = this.yxRoomId;
    data['password'] = this.password;
    data['charismaShow'] = this.charismaShow;
    data['backgroundImg'] = this.backgroundImg;
    data['lockFlag'] = this.lockFlag;
    data['roomLabel'] = this.roomLabel;
    data['homeownerNickname'] = this.homeownerNickname;
    data['homeownerIcon'] = this.homeownerIcon;
    if (this.voiceMikeDetailVoList != null) {
      data['voiceMikeDetailVoList'] =
          this.voiceMikeDetailVoList.map((v) => v.toJson()).toList();
    }
    data['agoraToken'] = this.agoraToken;
    data['homeownerId'] = this.homeownerId;
    data['relationType'] = this.relationType;
    data['coverImg'] = this.coverImg;
    data['roomState'] = this.roomState;
    data['valid'] = this.valid;
    data['charisma'] = this.charisma;
    return data;
  }
}

